package com.jzy.gulimall.member.web;

import com.jzy.common.utils.R;
import com.jzy.gulimall.member.feign.OrderFeignService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author jzy
 * @date 2020/9/23 9:54
 */
@Controller
public class MemberWebController {

    @Resource
    private OrderFeignService orderFeignService;

    /**
     * aiPay支付
     * 同步回调
     */
    @GetMapping("memberOrder.html")
    public String memberOrderPage(@RequestParam Map<String, Object> params, Model model){
        //查出当前登录的用户的订单列表数据
        R r = orderFeignService.listWithItem(params);
        model.addAttribute("orders", r);
        //支付成功,修改订单状态,验证签名 使用异步通知
        return "orderList";
    }
}
